package com.heima.oopAdvanced.n01static.demo03;

import java.util.ArrayList;

public class TestDemo {
    /**
     * 定义一个集合, 存储3个学生对象
     * 学生类: name, age, gender
     * 定义一个工具类, 用于获取集合中最大学生的年龄
     */
    public static void main(String[] args) {
        ArrayList<Student> students = new ArrayList<>();
        Student stu1 = new Student("小a", 11, "男");
        Student stu2 = new Student("小b", 12, "女");
        Student stu3 = new Student("小c", 10, "男");
        students.add(stu1);
        students.add(stu2);
        students.add(stu3);

        System.out.println(StudentUtil.getMaxAge(students));
    }
}
